'   T%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%W%
 
 '   Q%  E G D 1   -   P r o d u c t i o n   -   V 2                                             Q%
 
 '   Z%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%]%
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   M O T O R   P A R A M E T E R S 
 
 M a x T O R Q U E   =   2 0 0 	 '     2 0 0 
 
 M a x A C C   =       1 0 0 0 	 '   1 0 0 0 
 
 M a x R P M   =       1 0 0 0 	 '   1 0 0 0 
 
 
 
 P i d K P     =       5 0 	 '   5 0 
 
 P i d K I     =       5 0 	 '   5 0 
 
 P i d K D     =       5 0 	 '     0 
 
 D e a d B a n d   =     1 	 '     5 
 
 
 
 Z e r o S p e e d C u r r e n t   =   0 
 
 S t a r t S e n s o r M o d e   =   0 
 
 
 
 K r e d u c t i o n   =   4 1 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   S L O T S 
 
 V a r i a b l e   N u m e r i c   s _ A c t u a l P o s       =   1 1 0 
 
 V a r i a b l e   N u m e r i c   s _ I d S e n s o r         =   1 2 7 
 
 V a r i a b l e   N u m e r i c   s _ W r i t e P r o t       =   1 5 0 
 
 V a r i a b l e   N u m e r i c   s _ W o r k i n g M o d e   =   1 5 1 
 
 V a r i a b l e   N u m e r i c   s _ G o a l P o s           =   1 5 8 
 
 V a r i a b l e   N u m e r i c   s _ G o a l T o r q u e     =   1 6 2 
 
 V a r i a b l e   N u m e r i c   s _ G o a l A c c           =   1 6 4 
 
 V a r i a b l e   N u m e r i c   s _ G o a l S p e e d       =   1 6 6 
 
 V a r i a b l e   N u m e r i c   s _ P i d P                 =   1 6 8 
 
 V a r i a b l e   N u m e r i c   s _ P i d I                 =   1 6 9 
 
 V a r i a b l e   N u m e r i c   s _ P i d D                 =   1 7 0 
 
 V a r i a b l e   N u m e r i c   s _ D e a d B a n d         =   1 7 1 
 
 V a r i a b l e   N u m e r i c   s _ Z e r o C u r r e n t   =   1 7 2 
 
 ' V a r i a b l e   N u m e r i c   s _ M a g S e n s _ W o r k M o d e     =   1 8 8 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   B U T T O N S   a n d   K E Y S 
 
 B u t t o n   1   L a b e l   C h a n g e S p e e d 
 
 B u t t o n   C h a n g e S p e e d   C o l o r   Y e l l o w 
 
 
 
 B u t t o n   3   L a b e l   T u r n 1 
 
 B u t t o n   T u r n 1   T e x t   " U n   g i r o " 
 
 B u t t o n   T u r n 1   C o l o r   G r e e n Y e l l o w 
 
 B u t t o n   4   L a b e l   T u r n 1 0 
 
 B u t t o n   T u r n 1 0   T e x t   " D i e c i   g i r i " 
 
 B u t t o n   T u r n 1 0   C o l o r   G r e e n Y e l l o w 
 
 B u t t o n   5   L a b e l   T u r n 1 0 0 
 
 B u t t o n   T u r n 1 0 0   T e x t   " C e n t o   g i r i " 
 
 B u t t o n   T u r n 1 0 0   C o l o r   G r e e n Y e l l o w 
 
 B u t t o n   6   L a b e l   G o t o - Z e r o 
 
 B u t t o n   G o t o - Z e r o   T e x t   " T o r n a   a   z e r o " 
 
 B u t t o n   G o t o - Z e r o   C o l o r   G o l d 
 
 
 
 B u t t o n   1 7   L a b e l   E n a b l e C o n n e c t i o n 
 
 B u t t o n   E n a b l e C o n n e c t i o n   T e x t   " C o n n e t t i " 
 
 B u t t o n   E n a b l e C o n n e c t i o n   C o l o r   G r e e n Y e l l o w 
 
 B u t t o n   1 8   L a b e l   D i s a b l e C o n n e c t i o n 
 
 B u t t o n   D i s a b l e C o n n e c t i o n   T e x t   " D i s c o n n e t t i " 
 
 B u t t o n   D i s a b l e C o n n e c t i o n   C o l o r   G o l d 
 
 
 
 B u t t o n   2 0   L a b e l   W r i t e F i r m w a r e 
 
 B u t t o n   W r i t e F i r m w a r e   T e x t   " S c r i v i   i l   f i r m w a r e " 
 
 B u t t o n   W r i t e F i r m w a r e   C o l o r   Y e l l o w 9 
 
 B u t t o n   2 2   L a b e l   S e n d R e s e t 
 
 B u t t o n   S e n d R e s e t   T e x t   " I n v i a   r e s e t " 
 
 B u t t o n   S e n d R e s e t   C o l o r   G o l d 
 
 
 
 B u t t o n   3 3   L a b e l   I d S e n s o r 
 
 
 
 K e y   U p       R e a d K e y s 
 
 K e y   D o w n   R e a d K e y s 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   A P P S 
 
 ' L o a d   " T h e r e m i n o _ R S 4 8 5 . e x e " 
 
 L o a d   " T h e r e m i n o _ M o t o r s . e x e " 
 
 L o a d   " T h e r e m i n o _ S l o t V i e w e r . e x e " 
 
 L o a d   " T h e r e m i n o _ S i g n a l S c o p e 1 . e x e " 
 
 L o a d   " T h e r e m i n o _ S i g n a l S c o p e 2 . e x e " 
 
 L o a d   " T h e r e m i n o _ S i g n a l S c o p e 3 . e x e " 
 
 L o a d   " T h e r e m i n o _ H a l . e x e " 
 
 ' L o a d   " C : \ P r o g r a m   F i l e s   ( x 8 6 ) \ P i c o   T e c h n o l o g y \ P i c o S c o p e 6 \ P i c o S c o p e . e x e " 
 
 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   S T A R T 
 
 O p t i o n   S p e e d   9 
 
 S h o w S p e e d 
 
 W a i t G o o d C o m m u n i c a t i o n 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   L O O P 
 
 G o s u b   L o o p 
 
 S t o p 
 
 
 
 L a b e l   T e s t C o m m u n i c a t i o n 
 
 	 I f   S l o t ( 5 6 )   <   1 0 
 
 	 	 W a i t G o o d C o m m u n i c a t i o n 
 
 	 E n d I f 
 
 R e t u r n 
 
 
 
 L a b e l   W a i t G o o d C o m m u n i c a t i o n 
 
 	 F o r   v 1   =   1   T o   I n f i n i t y 
 
 	 	 I f   S l o t ( 5 6 )   >   5 0 
 
 	 	 	 v 2   =   v 2   +   1 
 
 	 	 E l s e 
 
 	 	 	 v 2   =   0 
 
 	 	 E n d I f 
 
 	 	 I f   v 2   >   5 0 
 
 	 	 	 B e e p   1 6 6 0   4 0 
 
 	 	 	 I n i t A l l P a r a m s 
 
 	 	 	 E x i t 
 
 	 	 E n d I f 
 
 	 	 P r i n t   "   > > > > > > >   E R R O R E   D I   C O M U N I C A Z I O N E   < < < < < < < " 
 
 	 	 W a i t   S e c o n d s   0 . 0 1 
 
 	 N e x t 
 
 R e t u r n 
 
 
 
 L a b e l   I n i t A l l P a r a m s 
 
 	 S l o t   s _ G o a l T o r q u e   =   0 
 
 	 S l o t   s _ G o a l A c c   =   0 
 
 	 S l o t   s _ G o a l S p e e d   =   0 
 
 	 S l o t   s _ P i d P   =   0 
 
 	 S l o t   s _ P i d I   =   0 
 
 	 S l o t   s _ P i d D   =   0 
 
 	 S l o t   s _ D e a d B a n d   =   0 
 
 	 S l o t   s _ Z e r o C u r r e n t   =   0 
 
 	 P o s i t i o n   =   S l o t ( s _ A c t u a l P o s ) 
 
 	 D e s t i n a t i o n   =   P o s i t i o n 
 
 	 S l o t ( s _ G o a l P o s )   =   D e s t i n a t i o n 
 
 	 S l o t   s _ G o a l T o r q u e   =   M a x T O R Q U E 
 
 	 S l o t   s _ G o a l A c c   =   M a x A C C 
 
 	 S l o t   s _ G o a l S p e e d   =   M a x R P M 
 
 	 S l o t   s _ P i d P   =   P i d K P 
 
 	 S l o t   s _ P i d I   =   P i d K I 
 
 	 S l o t   s _ P i d D   =   P i d K D 
 
 	 S l o t   s _ D e a d B a n d   =   D e a d B a n d 
 
 	 S l o t   s _ Z e r o C u r r e n t   =   Z e r o S p e e d C u r r e n t 
 
 	 W a i t   S e c o n d s   0 . 1 
 
 	 S e t W o r k i n g M o d e ( 1 )   '   1   =   P o s i t i o n 
 
 R e t u r n 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   S T O P 
 
 L a b e l   E v e n t S t o p 
 
 	 S t o p M o t o r 
 
 E n d 
 
 
 
 L a b e l   S t o p M o t o r 
 
 	 D e s t i n a t i o n   =   P o s i t i o n 
 
 	 U p d a t e M o t o r V a l u e s 
 
 	 S e t W o r k i n g M o d e ( 0 ) 
 
 R e t u r n 
 
 
 
 '   - - - - - - - - - - - - -   S E T   W O R K I N G   M O D E   1 = P o s i t i o n   2 = S p e e d 
 
 L a b e l   S e t W o r k i n g M o d e 
 
 	 V a r i a b l e   N u m e r i c   S W M 1 
 
 	 S l o t ( s _ W r i t e P r o t )   =   1       '   W r i t e - P r o t e c t i o n   O N 
 
 	 W a i t   S e c o n d s   0 . 0 5 
 
 	 S l o t ( s _ W r i t e P r o t )   =   0       '   W r i t e - P r o t e c t i o n   O F F 
 
 	 W a i t   S e c o n d s   0 . 0 5 
 
 	 S l o t ( s _ W o r k i n g M o d e )   =   0   '   W o r k i n g   m o d e   =   0 
 
 	 W a i t   S e c o n d s   0 . 0 5 
 
 	 S l o t ( s _ W o r k i n g M o d e )   =   S W M 1   '   W o r k i n g   m o d e 
 
 	 W a i t   S e c o n d s   0 . 0 5 
 
 	 S l o t ( s _ W r i t e P r o t )   =   1       '   W r i t e - P r o t e c t i o n   O N 
 
 R e t u r n 
 
 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   B U T T O N   E X E C U T I O N 
 
 L a b e l   W o r k i n g M o d e 
 
 	 V a r i a b l e   N u m e r i c   W K M 1 
 
 	 W K M 1   =   S l o t ( s _ W o r k i n g M o d e )   +   1 
 
 	 W K M 1   =   M o d ( W K M 1   ,   2 ) 
 
 	 S e t W o r k i n g M o d e ( W K M 1 ) 
 
 R e t u r n 
 
 
 
 L a b e l   C h a n g e S p e e d 
 
 	 S e l e c t   S l o t ( s _ G o a l S p e e d ) 
 
 	 	 C a s e   5 0 0 
 
 	 	 	 S l o t ( s _ G o a l S p e e d )   =   1 0 0 0 
 
 	 	 C a s e   1 0 0 0 
 
 	 	 	 S l o t ( s _ G o a l S p e e d )   =   1 5 0 0 
 
 	 	 C a s e E l s e 
 
 	 	 	 S l o t ( s _ G o a l S p e e d )   =   5 0 0 
 
 	 E n d S e l e c t 
 
 	 S h o w S p e e d 
 
 	 M a x R P M   =   S l o t ( s _ G o a l S p e e d ) 
 
 R e t u r n 
 
 
 
 L a b e l   S h o w S p e e d 
 
 	 B u t t o n   C h a n g e S p e e d   T e x t   " R P M   =   "   +   S l o t ( s _ G o a l S p e e d ) 
 
 R e t u r n 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   M O V E   B U T T O N S 
 
 L a b e l   T u r n 1 
 
 	 D e s t i n a t i o n   =   D e s t i n a t i o n   +   3 6 0   *   K r e d u c t i o n 
 
 R e t u r n 
 
 L a b e l   T u r n 1 0 
 
 	 D e s t i n a t i o n   =   D e s t i n a t i o n   +   3 6 0 0   *   K r e d u c t i o n 
 
 R e t u r n 
 
 L a b e l   T u r n 1 0 0 
 
 	 D e s t i n a t i o n   =   D e s t i n a t i o n   -   3 6 0 0 0   *   K r e d u c t i o n 
 
 R e t u r n 
 
 
 
 L a b e l   G o t o - Z e r o 
 
 	 D e s t i n a t i o n   =   0 
 
 R e t u r n 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   C O M M E N D S   T O   M O T O R S   A P P 
 
 L a b e l   E n a b l e C o n n e c t i o n 
 
 	 S e n d C o m m a n d ( S l o t _ C o m m a n d s ) ( " E n a b l e C o n n e c t i o n " ) 
 
 R e t u r n 
 
 L a b e l   D i s a b l e C o n n e c t i o n 
 
 	 S e n d C o m m a n d ( S l o t _ C o m m a n d s ) ( " D i s a b l e C o n n e c t i o n " ) 
 
 R e t u r n 
 
 
 
 L a b e l   W r i t e F i r m w a r e 
 
 	 S e n d C o m m a n d ( S l o t _ C o m m a n d s ) ( " W r i t e F i r m w a r e " ) 
 
 R e t u r n 
 
 L a b e l   S e n d R e s e t 
 
 	 S e n d C o m m a n d ( S l o t _ C o m m a n d s ) ( " S e n d R e s e t " ) 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     S E N D   C O M M A N D   ( d e f a u l t   t i m e o u t   =   0 . 5   S e c ) 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 V a r i a b l e   N u m e r i c   S l o t _ C o m m a n d s   =   5 0 
 
 
 
 L a b e l   S e n d C o m m a n d 
 
 	 V a r i a b l e   N u m e r i c   S C 1               ' < - -   P a r a m e t e r   D e s t i n a t . - S l o t 
 
 	 V a r i a b l e   S t r i n g     S C 2               ' < - -   P a r a m e t e r   C o m m a n d - S t r i n g 
 
 	 V a r i a b l e   N u m e r i c   S C 3   =   0 . 5   ' < - -   T h e   t i m e o u t   i n   s e c o n d s 
 
 	 V a r i a b l e   N u m e r i c   S C 4 
 
 	 S l o t T e x t   S C 1   =   S C 2 
 
 	 F o r   S C 4   =   0 . 1   T o   S C 3   S t e p   0 . 1 
 
 	 	 I f   S l o t T e x t ( S C 1 )   =   " " 
 
 	 	 	 E x i t 
 
 	 	 E n d I f 
 
 	 	 W a i t   S e c o n d s   0 . 1 
 
 	 N e x t 
 
 R e t u r n 
 
 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   K E Y S 
 
 L a b e l   R e a d K e y s 
 
 	 V a r i a b l e   N u m e r i c   J o g S p e e d 
 
 	 J o g S p e e d   =   1 
 
 	 S e l e c t   T r u e 
 
 	 	 C a s e   K e y ( " S H I F T " ) 
 
 	 	 	 J o g S p e e d   =   J o g S p e e d   *   1 0 0 
 
 	 	 C a s e   K e y ( " C T R L " ) 
 
 	 	 	 J o g S p e e d   =   J o g S p e e d   *   1 0 
 
 	 	 C a s e   K e y ( " A L T " ) 
 
 	 	 	 J o g S p e e d   =   J o g S p e e d   *   0 . 0 1 
 
 	 E n d S e l e c t 
 
 	 I f   K e y ( " U P " ) 
 
 	 	 D e s t i n a t i o n   =   D e s t i n a t i o n   +   J o g S p e e d 
 
 	 E n d I f 
 
 	 I f   K e y ( " D O W N " ) 
 
 	 	 D e s t i n a t i o n   =   D e s t i n a t i o n   -   J o g S p e e d 
 
 	 E n d I f 
 
 R e t u r n 
 
 
 
 L a b e l   P r i n t V a l u e s 
 
 	 s 1   =   " D e s t i n a t i o n :   "   +   F o r m a t ( D e s t i n a t i o n ,   " 0 . 0 0 " ) 
 
 	 s 1   =   s 1   +   "       P o s i t i o n :   "   +   F o r m a t ( P o s i t i o n ,   " 0 . 0 0 " ) 
 
 	 P r i n t   s 1 
 
 	 
 
 	 B u t t o n   I d S e n s o r   T e x t   " S e n s o r   =   "   +   I n t ( S l o t ( s _ I d S e n s o r ) / 4 0 )   +   " % " 
 
 R e t u r n 
 
 
 
 '   T%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%W%
 
 '   Q%  L O O P   a n d   M O T O R   C O N T R O L                                           Q%
 
 '   Z%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%]%
 
 L a b e l   L o o p 
 
 	 T e s t C o m m u n i c a t i o n 
 
 	 U p d a t e M o t o r V a l u e s 
 
 	 P r i n t V a l u e s 
 
 	 W a i t   S e c o n d s   0 . 0 1 
 
 G o t o   L o o p 
 
 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   M O T O R   C O N T R O L 
 
 V a r i a b l e   N u m e r i c   M a x T O R Q U E 
 
 V a r i a b l e   N u m e r i c   M a x A C C 
 
 V a r i a b l e   N u m e r i c   M a x R P M 
 
 V a r i a b l e   N u m e r i c   P o s i t i o n 
 
 V a r i a b l e   N u m e r i c   D e s t i n a t i o n 
 
 V a r i a b l e   N u m e r i c   P i d K P 
 
 V a r i a b l e   N u m e r i c   P i d K I 
 
 V a r i a b l e   N u m e r i c   P i d K D 
 
 V a r i a b l e   N u m e r i c   D e a d B a n d 
 
 V a r i a b l e   N u m e r i c   Z e r o S p e e d C u r r e n t 
 
 V a r i a b l e   N u m e r i c   S t a r t S e n s o r M o d e 
 
 V a r i a b l e   N u m e r i c   K r e d u c t i o n 
 
 
 
 L a b e l   U p d a t e M o t o r V a l u e s 
 
 	 S l o t ( s _ G o a l P o s )   =   D e s t i n a t i o n 
 
 	 P o s i t i o n   =   S l o t ( s _ A c t u a l P o s ) 
 
 R e t u r n 
 
 
 
 L a b e l   M o v e B y 
 
 	 V a r i a b l e   N u m e r i c   M B 1 
 
 	 D e s t i n a t i o n   =   D e s t i n a t i o n   +   M B 1 
 
 	 U p d a t e M o t o r V a l u e s 
 
 R e t u r n 
 
 
 
 
 
 ' B O O K M A R K S   
 
 
 
 ' E D I T E D L I N E S   1 0 8   4   5 5   1   5 9   8   6 2   8   6 6   4   3 9   5   4 2   6   4 5   7   2 6 3   9   1 1   1 0   
 
 
 
 